
import 'dart:convert';

import 'package:safetymonitor/app/data/common/choice_bean.dart';
import 'package:safetymonitor/generated/json/base/json_convert_content.dart';
import 'package:safetymonitor/generated/json/base/json_field.dart';
///作业相关人员
@JsonSerializable()
class ExecuteTicketReceiptListOperatorLists implements ChoiceBean {
  ExecuteTicketReceiptListOperatorLists();

  factory ExecuteTicketReceiptListOperatorLists.fromJson(Map<String, dynamic> json) =>
      $ExecuteTicketReceiptListOperatorListsFromJson(json);

  ///	企业编码
  String? companyCode = '';

  ///创建人
  String? createBy = '';

  ///创建时间
  String? createDate = '';

  ///	主键ID
  String? id = '';

  ///	操作人证书ID
  String? operatorCertificateId = '';

  ///作业人类型 0：作业实施人 1：作业负责人 2：监护人 3:编制人 4：司索人 5:指挥人 6：用电人 7：安全交底人 8：接受交底人 9：验收人
  int? operatorType = 0;

  ///作业人ID
  String? operatorUserId = '';

  ///作业人名称
  String? operatorUserName = '';

  ///作业人签字
  String? operatorUserSign = '';

  ///作业计划ID
  String? ticketPlanId = '';

  ///	作业票ID
  String? ticketReceiptId = '';

  ///	修改人
  String? updateBy = '';

  /// 修改时间
  String? updateDate = '';

  /// 作业人类型中文
  String operatorName = '';
  String phone = '';

  /// 记录是否为交接班数据 null或0为正常数据,1为正在交接班数据,交接数据可以进行编辑
  int? number = 0;

  /// 是否选中
  bool isChecked = false;

  @override
  String getId() {
    return operatorUserId!;
  }

  @override
  bool getIsChecked() {
    return isChecked;
  }

  @override
  String getShowName() {
    return operatorUserName!;
  }

  @override
  setIsChecked(bool isChecked) {
    this.isChecked = isChecked;
  }

  Map<String, dynamic> toJson() => $ExecuteTicketReceiptListOperatorListsToJson(this);

  ExecuteTicketReceiptListOperatorLists copyWith(
      {String? companyCode,
        String? createBy,
        String? createDate,
        String? id,
        String? operatorCertificateId,
        int? operatorType,
        int? number,
        String? operatorUserId,
        String? operatorUserName,
        String? operatorUserSign,
        String? ticketPlanId,
        String? ticketReceiptId,
        String? updateBy,
        String? operatorName,
        String? updateDate}) {
    return ExecuteTicketReceiptListOperatorLists()
      ..companyCode = companyCode ?? this.companyCode
      ..createBy = createBy ?? this.createBy
      ..createDate = createDate ?? this.createDate
      ..id = id ?? this.id
      ..operatorCertificateId = operatorCertificateId ?? this.operatorCertificateId
      ..operatorType = operatorType ?? this.operatorType
      ..number = number ?? this.number
      ..operatorUserId = operatorUserId ?? this.operatorUserId
      ..operatorUserName = operatorUserName ?? this.operatorUserName
      ..operatorUserSign = operatorUserSign ?? this.operatorUserSign
      ..ticketPlanId = ticketPlanId ?? this.ticketPlanId
      ..ticketReceiptId = ticketReceiptId ?? this.ticketReceiptId
      ..updateBy = updateBy ?? this.updateBy
      ..operatorName = operatorName ?? this.operatorName
      ..updateDate = updateDate ?? this.updateDate;
  }

  @override
  String toString() {
    return jsonEncode(this);
  }
}

ExecuteTicketReceiptListOperatorLists $ExecuteTicketReceiptListOperatorListsFromJson(Map<String, dynamic> json) {
  final ExecuteTicketReceiptListOperatorLists executeTicketReceiptListOperatorLists = ExecuteTicketReceiptListOperatorLists();
  final String? companyCode = jsonConvert.convert<String>(json['companyCode']);
  if (companyCode != null) {
    executeTicketReceiptListOperatorLists.companyCode = companyCode;
  }
  final String? createBy = jsonConvert.convert<String>(json['createBy']);
  if (createBy != null) {
    executeTicketReceiptListOperatorLists.createBy = createBy;
  }
  final String? createDate = jsonConvert.convert<String>(json['createDate']);
  if (createDate != null) {
    executeTicketReceiptListOperatorLists.createDate = createDate;
  }
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    executeTicketReceiptListOperatorLists.id = id;
  }
  final String? operatorCertificateId = jsonConvert.convert<String>(json['operatorCertificateId']);
  if (operatorCertificateId != null) {
    executeTicketReceiptListOperatorLists.operatorCertificateId = operatorCertificateId;
  }
  final int? operatorType = jsonConvert.convert<int>(json['operatorType']);
  if (operatorType != null) {
    executeTicketReceiptListOperatorLists.operatorType = operatorType;
  }
  final String? operatorUserId = jsonConvert.convert<String>(json['operatorUserId']);
  if (operatorUserId != null) {
    executeTicketReceiptListOperatorLists.operatorUserId = operatorUserId;
  }
  final String? operatorUserName = jsonConvert.convert<String>(json['operatorUserName']);
  if (operatorUserName != null) {
    executeTicketReceiptListOperatorLists.operatorUserName = operatorUserName;
  }
  final String? operatorUserSign = jsonConvert.convert<String>(json['operatorUserSign']);
  if (operatorUserSign != null) {
    executeTicketReceiptListOperatorLists.operatorUserSign = operatorUserSign;
  }
  final String? ticketPlanId = jsonConvert.convert<String>(json['ticketPlanId']);
  if (ticketPlanId != null) {
    executeTicketReceiptListOperatorLists.ticketPlanId = ticketPlanId;
  }
  final String? ticketReceiptId = jsonConvert.convert<String>(json['ticketReceiptId']);
  if (ticketReceiptId != null) {
    executeTicketReceiptListOperatorLists.ticketReceiptId = ticketReceiptId;
  }
  final String? updateBy = jsonConvert.convert<String>(json['updateBy']);
  if (updateBy != null) {
    executeTicketReceiptListOperatorLists.updateBy = updateBy;
  }
  final String? updateDate = jsonConvert.convert<String>(json['updateDate']);
  if (updateDate != null) {
    executeTicketReceiptListOperatorLists.updateDate = updateDate;
  }
  final String? operatorName = jsonConvert.convert<String>(json['operatorName']);
  if (operatorName != null) {
    executeTicketReceiptListOperatorLists.operatorName = operatorName;
  }
  final int? number = jsonConvert.convert<int>(json['number']);
  if (number != null) {
    executeTicketReceiptListOperatorLists.number = number;
  }
  final bool? isChecked = jsonConvert.convert<bool>(json['isChecked']);
  if (isChecked != null) {
    executeTicketReceiptListOperatorLists.isChecked = isChecked;
  }
  return executeTicketReceiptListOperatorLists;
}
Map<String, dynamic> $ExecuteTicketReceiptListOperatorListsToJson(ExecuteTicketReceiptListOperatorLists entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['companyCode'] = entity.companyCode;
  data['createBy'] = entity.createBy;
  data['createDate'] = entity.createDate;
  data['id'] = entity.id;
  data['operatorCertificateId'] = entity.operatorCertificateId;
  data['operatorType'] = entity.operatorType;
  data['operatorUserId'] = entity.operatorUserId;
  data['operatorUserName'] = entity.operatorUserName;
  data['operatorUserSign'] = entity.operatorUserSign;
  data['ticketPlanId'] = entity.ticketPlanId;
  data['ticketReceiptId'] = entity.ticketReceiptId;
  data['updateBy'] = entity.updateBy;
  data['updateDate'] = entity.updateDate;
  data['operatorName'] = entity.operatorName;
  data['number'] = entity.number;
  data['isChecked'] = entity.isChecked;
  return data;
}
